1. Field of the Invention
The present invention relates to computer-based tools for manipulating digital images. More specifically, the present invention relates to a method and an apparatus for resizing and image that uses nonlinear filtering to preserve sharp detail.
2. Related Art
In recent years, a number of techniques have been developed to resize digital images. These techniques typically use a “kernel filter” to generate pixel values for the resized image. For example, U.S. Pat. No. 6,816,622, entitled “Generating Resized Images Using Ripple-Free Image Filtering,” describes such a system that uses linear kernel filters to generate resized images. (This patent is hereby incorporated by reference to describe general details of the kernel filtering process.)
To achieve high-quality resized images, people have focused on developing high-quality kernels. To this end, “Bilinear,” “Bicubic” and “Sinc” kernels have been developed to perform image resizing operations. Theoretically, the best kernel is the “Sinc” kernel, but it is slow, so people use approximations, such as Bicubic, or other kernels. When speed is critical, people typically use Bilinear kernels.
With all of these kernels, edges become soft when an image is magnified. Images can subsequently be “sharpened” to improve edges, but sharpening an image brings out noise and produces ringing artifacts. The reason for the blurry edges in conventionally resized images is that the kernel used to generate the resized image mixes pixels from both sides of a sharp edge. For example, if pixels on one side of an edge are red, and pixels on the other side are blue, after the image is resized using a standard kernel, pixels in a region close to the middle of the new edge are somewhat purple. This is all due to the sampling kernel, since there is nothing purple in the original image.
If we make the kernel “infinitely small” to avoid this inappropriate mixing of red and blue, we get a one-pixel kernel, which produces a jagged-looking output that results from nearest-neighbor resampling. This is much worse than the result of a blurry resampling with a larger kernel.
It is possible to perform “sharpening” operations on a resized image to achieve better edges. However, doing so brings out noise and produces ringing artifacts. This noise can be avoided by detecting the edges and sharpening only the edges, or by using more sophisticated sharpening techniques. However, all of these approaches seek to fix damage that has already been caused by a flawed resizing operation, which blurs sharp edges.
Hence, what is needed is a method and an apparatus for resizing a digital image without the problems described above.